% TEST_ID: LANG-EXPAND-0025
% CATEGORY: language/array-ops/cat
% 测试垂直拼接数组

function test_vertcat
    A = [1, 2; 3, 4];
    B = [5, 6; 7, 8];
    C = vertcat(A, B);
    assert(isequal(C, [1, 2; 3, 4; 5, 6; 7, 8]));

    A = [1, 2];
    B = [3, 4; 5, 6];
    C = vertcat(A, B);
    assert(isequal(C, [1, 2; 3, 4; 5, 6]));

    A = [1; 2; 3];
    B = [4; 5; 6];
    C = vertcat(A, B);
    assert(isequal(C, [1; 2; 3; 4; 5; 6]));

    A = 'Hello';
    B = 'World';
    C = vertcat(A, B);
    assert(isequal(C, ['Hello'; 'World']));

    A = {1, 2; 3, 4};
    B = {5, 6; 7, 8};
    C = vertcat(A, B);
    assert(isequal(C, {1, 2; 3, 4; 5, 6; 7, 8}));

    A = [{1}, 2];
    B = {3, 4};
    C = vertcat(A, B);
    assert(isequal(C, {1, 2; 3, 4}));
end


